1 def deco(func):
2 def wrap():
3 print("================")
4 func()
5 print("================")
6 return wrap
7
8 def welcome():
9 print("Welcome to Game")
10
11 decoration=deco(welcome)
12 decoration()
13
14 import random
15
16 b = random.randint(1, 9)
17
18 def condition():
19 c=int(input("Enter a Number Again:"))
20 if c==b:
21 print("You are Winner of this game")
22 print(b)
23
24 else:
25 print("You Lose")
26 print(b)
27
28 f = random.randint(1, 9)
29
30 def condition2():
31 e=int(input("Enter a Number Again:"))
32 if e==f:
33 print("You are Winner of this game")
34 print(f)
35
36 else:
37 print("You Lose")
38 print(f)
39
40
41
42 def game():
43 a = int(input("Guess the Number between 1 to 9:"))
44
45 def error():
46 if a > 9:
47 print("!!!...Enter a Single Digit Number...!!!")
48
49 error()
50
51 if a==b:
52 print("You are Winner of this game")
53 print(b)
54
55 elif a==b+1:
56 print("You are Just Near to Ur Answer,Try Again")
57 condition()
58
59 elif a==b-1:
60 print("You are Just Near to Ur Answer,Try Again")
61 condition()
62
63 else:
64 print("You Lose")
65 print(b)
66
67 def game2():
68
69 d = int(input("Try Again:"))
70
71 def error():
72 if d > 9:
73 print("!!!...Enter a Single Digit Number...!!!")
74 error()
75
76
77 if d==f:
78 print("You are Winner of this game")
79 print(f)
80
81 elif d==f+1:
82 print("You are Just Near to Ur Answer,Try Again")
83 condition2()
84
85 elif d==f-1:
86 print("You are Just Near to Ur Answer,Try Again")
87 condition2()
88
89 else:
90 print("You Lose")
91 print(f)
92
93
94 import random
95
96 b = random.randint(1, 9)
97
98 def condition():
99 c=int(input("Enter a Number Again:"))
100 if c==b:
101 print("You are Winner of this game")
102 print(b)
103
104 else:
105 print("You Lose")
106 print(b)
107
108 f = random.randint(1, 9)
109
110 def condition2():
111 e=int(input("Enter a Number Again:"))
112 if e==f:
113 print("You are Winner of this game")
114 print(f)
115
116 else:
117 print("You Lose")
118 print(f)
119
120
121
122 def game():
123 a = int(input("Guess the Number between 1 to 9:"))
124
125 def error():
126 if a > 9:
127 print("!!!...Enter a Single Digit Number...!!!")
128
129 error()
130
131 if a==b:
132 print("You are Winner of this game")
133 print(b)
134
135 elif a==b+1:
136 print("You are Just Near to Ur Answer,Try Again")
137 condition()
138
139 elif a==b-1:
140 print("You are Just Near to Ur Answer,Try Again")
141 condition()
142
143 else:
144 print("You Lose")
145 print(b)
146
147 def game2():
148
149 d = int(input("Try Again:"))
150
151 def error():
152 if d > 9:
153 print("!!!...Enter a Single Digit Number...!!!")
154 error()
155
156
157 if d==f:
158 print("You are Winner of this game")
159 print(f)
160
161 elif d==f+1:
162 print("You are Just Near to Ur Answer,Try Again")
163 condition2()
164
165 elif d==f-1:
166 print("You are Just Near to Ur Answer,Try Again")
167 condition2()
168
169 else:
170 print("You Lose")
171 print(f)
172
173 def again():
174 s=input("Want To Continue y/n :")
175 if (s=='y'):
176 game()
177 game2()
178 again()
179 game()
180 game2()
181 again()